1. Technical Field
The present invention relates to a method and system for evaluating a library function call at compile time, and more particularly to a technique for replacing, at compile time, a library function call whose one or more arguments are constant with the result of the function call.
2. Related Art
Conventionally, the evaluation of a library function call with compile time constant arguments is performed during a program's runtime, as any reference to a preprocessed library is treated in the same manner as a function call. Depending on whether static or dynamic linking is used, the linker or loader ensures that the code to evaluate the library function call is available to the program during runtime. Since the evaluation of the function call waits until program execution, there is overhead from call linkage, parameter loading and unloading, function prologue, function epilogue, and return linkage. Thus, there exists a need to overcome at least one of the aforementioned deficiencies and limitations of the related art.